package com.pandy.juc;

import java.util.concurrent.ConcurrentHashMap;

/**
 * @description:
 * @author: panhong
 * @date: 2025/3/21
 */
public class Code05_MapDemo {

    public static void main(String[] args) {
        ConcurrentHashMap<String, String> map = new ConcurrentHashMap<>();
        map.put("k1","v1");
        //String result = map.put("k1", "v2");
        String result = map.putIfAbsent("k1", "v2");

        System.out.println(result);
        System.out.println(map);
    }
}
